<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑风格样式</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="__PUBLIC__/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="__PUBLIC__/css/admin/style.css"/>       
        <link rel="stylesheet" href="__PUBLIC__/assets/css/ace.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/assets/css/font-awesome.min.css" />
        <link href="__PUBLIC__/Widget/icheck/icheck.css" rel="stylesheet" type="text/css" />
		<!--[if IE 7]>
		  <link rel="stylesheet" href="__PUBLIC__/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="__PUBLIC__/assets/css/ace-ie.min.css" />
		<![endif]-->
	    <script src="__PUBLIC__/js/admin/jquery-1.9.1.min.js"></script>
        <script src="__PUBLIC__/assets/js/bootstrap.min.js"></script>
        <script src="__PUBLIC__/assets/js/typeahead-bs2.min.js"></script>
         <script src="__PUBLIC__/assets/layer/layer.js" type="text/javascript"></script>
        <script type="text/javascript" src="__PUBLIC__/Widget/swfupload/swfupload.js"></script>
        <script type="text/javascript" src="__PUBLIC__/Widget/swfupload/swfupload.queue.js"></script>
        <script type="text/javascript" src="__PUBLIC__/Widget/swfupload/swfupload.speed.js"></script>
        <script type="text/javascript" src="__PUBLIC__/Widget/swfupload/handlers.js"></script>
</head>

<body>
<div class=" clearfix">
 <div id="add_brand" class="clearfix">
 
   <div class="title_name">编辑风格样式</div>
   <ul class="add_conent">
    <li class=" clearfix"><label class="label_name"><i>*</i>样式名称：</label> <input name="stylename" type="text" class="add_text"/></li>
    
          
         <li class=" clearfix">
         	<div class="Add_p_s">
             	 <label class="form-label col-2"><i>*</i>所属人群：</label>	
				 <div class="formControls col-2">
				 	<span class="select-box">&nbsp;
						<select id="crowd">
							<option>请选择</option>
							<option value="1">青年</option>
							<option value="2">中年</option>
							<option value="3">老年</option>
							<option value="4">孩童</option>					
						</select>
					</span>
				</div>
			</div>
					
				
			
		</li>
         <li class=" clearfix"><label class="label_name">样式描述：</label> <textarea name="content" cols="" rows="" class="textarea" ></textarea>
         <li class=" clearfix"><label class="label_name"><i>*</i>显示状态：</label> 
         <label><input name="status" type="radio" class="ace" checked="checked" value="1"><span class="lbl">显示</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <label><input type="radio" class="ace" name="status" value="0"><span class="lbl">不显示</span></label>
         </li>
   </ul>
    
  <div><input name="" type="button"  class="btn btn-warning" value="保存" id = "button"/><input name="" type="reset" value="取消" class="btn btn-warning"/></div>


</div>
</div>
<input type="hidden" value="{$id}" id="getId">
</body>
</html>

<script type="text/javascript">
  //添加操作
	$(function(){		
		//保存按钮事件
		$('#button').click(function(){
			var stylename =$("[name='stylename']").val();
			var crowd =$("#crowd").val();
			var content =$("[name='content']").val();
			var status =$("[name='status']:checked").val();
			var id =$("#getId").val();
			//拼接 数据
			var data = "stylename="+stylename+"&crowd="+crowd+"&content="+content+"&status="+status+"&id="+id;
			
			$.post('__MODULE__/Style/styleRedactSave',data,function(obj){
				
				if(obj.mes==1){
					layer.msg(obj.content,{icon:1});
					
				}else if(obj.mes==2){
					layer.msg(obj.content,{icon:2});
				}else if(obj.mes==3){	
					//判断哪一个字段名不符合格式，每次只显示第一个错误
					if(obj.content.stylename != undefined){
						layer.msg(obj.content.stylename,{icon:2});
					}else if(obj.content.crowd != undefined){
						layer.msg(obj.content.crowd,{icon:2});
					}else if(obj.content.content != undefined){
						layer.msg(obj.content.content,{icon:2}); 
					}
				}
			},'json');
		});
	})  
</script>





